import React from 'react'
// ===================================================================== Temp
import SearchForm from '#cpt/temp/SearchForm'
import Table from '#cpt/temp/Table'
import Controls from '#cpt/temp/Controls'
// ===================================================================== Declare
const { $fn, $Lazy } = window
// ===================================================================== Lazy
const message = $Lazy.file(()=>import('@antd/message'))
// ===================================================================== component
class Index extends React.Component{
	state = {
		data:[],
		pag: {},
		// 搜索表单列表
		forms : [
			{ label: '标本条码',		name: 'spec_code' },
			{ label: '实验号',		name: 'exper_num' },
			{ label: '时间',			names: ['start_date','end_date'], type:'date-range' },
		]
	}
	
	model = {}
	
	componentDidMount(){
		this.props.onRef?.(this)
	}
	
	// 查询项目paging
	fetch = () => $fn.fetch.call(this,'kd-report-spec/222')
	
	// 关联表单
	cols = [
		{ title: '标本条码',		dataIndex: 'spec_code', 	...$fn.table.spec_code },
		{ title: '实验号',		dataIndex: 'exper_num', 	width:150 },
		{ title: '姓名',			dataIndex: 'patient_name', 	...$fn.table.name },
		{ title: '性别',			dataIndex: 'sex_name', 		...$fn.table.sex },
		{ title: '年龄',			dataIndex: 'age', 			...$fn.table.age },
	]
	
	expands = () => {
		return [
			Controls.click.call(this,'检测结果赋值', ()=>{
				message.then(f => f.warning('暂不支持此功能'))
				//Confirm.call(this, '检测结果赋值', 'sp-gps-device/del', { param: [ uuid ], isKeys: !uuid })
			})
			
		]
	}
	render(){
		return (
			<>
				{/* 搜索 */}
				{ SearchForm.call(this, { expands: this.expands()}) }
				{/* 表格 */}
				{ Table.call(this, { type:null }) }
			</>
			
		)
	}
}

export default Index